import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
        redirect: "/index",
    },
    {
        path: "/index",
        name: "index",
        component: () =>
            import ("../views/index.vue"),
    }, 
    {
        path: "/destination",
        name: "destination",
        component: () =>
            import ("../views/destination.vue"),
    }, 
    {
        path: "/strategy_index",
        name: "strategy_index",
        component: () =>
            import ("../views/strategy_index.vue"),
    }, 
    {
        path: "/strategy_detail",
        name: "strategy_detail",
        component: () =>
            import ("../views/strategy_detail.vue"),
    }, 
    {
        path: "/travel_index",
        name: "travel_index",
        component: () =>
            import ("../views/travel_index.vue"),
    },
     {
        path: "/traveldetail",
        name: "traveldetail",
        component: () =>
            import ("../views/traveldetail.vue"),
    },
     {
        path: "/searchAll",
        name: "searchAll",
        component: () =>
            import ("../views/searchAll.vue"),
    },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
   {
    path: '/regist',
    name: 'regist',
    component: () => import('../views/regist.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (location) {
  return originalPush.call(this, location).catch((err) => {});
};
export default router
